package br.com.fidalgotecnologia.layar.entity;



import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.annotations.Fetch;
@Entity
@Table(schema="poi", name="layer")
@SequenceGenerator(sequenceName="poi.layer_id_seq" , name="layer_seq")
public class Layer implements Serializable {
	private Long id;
	private String layer;
	private int errorCode;
	private String errorString;
	private String nextPageKey;
	private boolean morePages;
	private Long radius;
	private int refreshInterval;
	private int refreshDistance;
	private boolean fullRefresh;
	private String showMessage;
	private boolean disableClueMenu;
	private String biwStyle;
	private List<HotSpot> hotSpots;
	
	
	@Id
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="layer_seq")
	@Column(name="id")
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	@Column(name="nome")
	public String getLayer() {
		return layer;
	}
	public void setLayer(String layer) {
		this.layer = layer;
	}
	
	public int getErrorCode() {
		return errorCode;
	}
	public void setErrorCode(int errorCode) {
		this.errorCode = errorCode;
	}
	public String getErrorString() {
		return errorString;
	}
	public void setErrorString(String errorString) {
		this.errorString = errorString;
	}
	public String getNextPageKey() {
		return nextPageKey;
	}
	public void setNextPageKey(String nextPageKey) {
		this.nextPageKey = nextPageKey;
	}
	
	public boolean isMorePages() {
		return morePages;
	}
	public void setMorePages(boolean morePages) {
		this.morePages = morePages;
	}
	
	@Column(name="radius")
	public Long getRadius() {
		return radius;
	}
	public void setRadius(Long radius) {
		this.radius = radius;
	}
	
	@Column(name="refresh_interval")
	public int getRefreshInterval() {
		return refreshInterval;
	}
	public void setRefreshInterval(int refreshInterval) {
		this.refreshInterval = refreshInterval;
	}
	
	@Column(name="refresh_distance")
	public int getRefreshDistance() {
		return refreshDistance;
	}
	public void setRefreshDistance(int refreshDistance) {
		this.refreshDistance = refreshDistance;
	}
	
	@Column(name="isRefresh")
	public boolean isFullRefresh() {
		return fullRefresh;
	}
	public void setFullRefresh(boolean fullRefresh) {
		this.fullRefresh = fullRefresh;
	}
	
	@Column(name="Message")
	public String getShowMessage() {
		return showMessage;
	}
	public void setShowMessage(String showMessage) {
		this.showMessage = showMessage;
	}
	@Column(name="clue_menu")
	public boolean isDisableClueMenu() {
		return disableClueMenu;
	}
	public void setDisableClueMenu(boolean disableClueMenu) {
		this.disableClueMenu = disableClueMenu;
	}
	@Column(name="biw_style")
	public String getBiwStyle() {
		return biwStyle;
	}
	public void setBiwStyle(String biwStyle) {
		this.biwStyle = biwStyle;
	}
	
	@OneToMany(fetch=FetchType.EAGER, cascade={CascadeType.ALL},mappedBy="layer")
	public List<HotSpot> getHotSpots() {
		return hotSpots;
	}
	public void setHotSpots(List<HotSpot> hotSpots) {
		this.hotSpots = hotSpots;
	}
		
}
